<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';

$zbp->Load();
$action = 'root';
if (!$zbp->CheckRights($action)) {
    $zbp->ShowError(6);
    die();
}
if (!$zbp->CheckPlugin('WordPaster')) {
    $zbp->ShowError(48);
    die();
}
WordPaster_init();
$blogtitle = 'Word一键粘贴控件';
require $blogpath . 'zb_system/admin/admin_header.php';
?>
<style type="text/css">
    .text-config {
        width: 95%
    }
</style>
<?php
require $blogpath . 'zb_system/admin/admin_top.php';

?>

<div id="divMain">
    <div class="divHeader"><?php echo $blogtitle; ?></div>
    <div class="SubMenu"><?php echo $WordPaster->export_submenu('main'); ?></div>
    <div id="divMain2">
        <form id="edit" name="edit" method="post" action="save_setting.php">
            <?php if (function_exists('CheckIsRefererValid')) {
    echo '<input type="hidden" name="csrfToken" value="' . $zbp->GetCSRFToken() . '">';
}?>
            <input id="reset" name="reset" type="hidden" value="" />
            <div class="content-box">
                <!-- Start Content Box -->

                <div class="content-box-header">
                    <ul class="content-box-tabs">
                        <li><a href="#tab1" class="default-tab"><span>授权设置</span></a></li>
                        <li><a href="#tab-about"><span>关于WordPaster</span></a></li>
                    </ul>
                    <div class="clear"></div>
                </div>
                <!-- End .content-box-header -->
                <div class="content-box-content" id="totorobox">
                    <div class="tab-content default-tab" style="border:none;padding:0px;margin:0;" id="tab1">
                        <table border="1" class="tableFull tableBorder table_hover table_striped">

                            <thead>
                                <tr>
                                    <th style="width:5%">
                                        <p align="left"><b>序号</b></p>
                                    </th>
                                    <th style="width:10%">
                                        <p align="left"><b>配置项</b></p>
                                    </th>
                                    <th>
                                        <p align="left"><b>值</b></p>
                                    </th>
                                    <th style="width:20%">
                                        <p align="left"><b>描述</b></p>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    $i = 1;
                                    foreach ($WordPaster->config_array as $name => $value) {
                                ?>
                                <tr>
                                    <td><?php echo $i ?></td>
                                    <td>
                                        <p align="left"><b><?php echo $value['NAME'] ?></b></p>
                                    </td>
                                    <td>
                                        <textarea rows="7" cols="20" type="text" class="text-config" name="WORDPASTER_<?php echo $name ?>" ><?php echo $value['VALUE'] ?></textarea>
                                    </td>
                                    <td>(默认：<?php echo $value['DEFAULT'] ?>) <?php echo $value['DESC'] ?></td>
                                </tr>
                                                                <?php
                                                                $i++;
                                }
?>
                            </tbody>
                        </table>
                    </div>

                    <div class="tab-content" style="border:none;padding:0px;margin:0;" id="tab-about">
                        <dl class="totoro">
                            <dd>WordPaster是一个为Web站点提供Word内容一键粘贴的插件，原作<a href="http://www.ncmem.com/" target="_blank">zysoft</a>。
                                <br/>
                                <a href="http://www.ncmem.com/webapp/wordpaster/pack.aspx" target="_blank">控件下载</a><br/>
                                <a href="http://www.ncmem.com/webapp/wordpaster/purchase.aspx" target="_blank">购买授权</a><br/>
                                <a href="http://www.ncmem.com/doc/view.aspx?id=29adc89a08ed489498160458cddfa51b" target="_blank">在线文档</a><br/>
                                <a href="http://shang.qq.com/wpa/qunwpa?idkey=9a105f1259eb48ee56eb41a38429de03c6b9c1e365c42ca858e303f6b3336ddc" target="_blank"><img src="http://pub.idqqimg.com/wpa/images/group.png" alt="泽优Word一键粘贴控件" title="泽优Word一键粘贴控件" style="height: auto; width: auto; max-width: 100%;"></a><br/>
                            </dd>
                            <dd>配置完成之后，请一定要测试，切记切记！</dd>
                            <dd></dd>
                        </dl>
                    </div>
                </div>
            </div>
            <hr/>
            <p>
                <input type="submit" class="button" value="<?php echo $lang['msg']['submit'] ?>" />
            </p>
        </form>
        <script type="text/javascript">
            $(function() {
                $(".escape-textarea").each(function() {
                    var self = $(this);
                    $("#" + self.attr("data-tag")).text(decodeURIComponent(self.val()));
                });

                $("#edit").submit(function() {
                    $(".unescape-textarea").each(function() {
                        var self = $(this);
                        $("#" + self.attr("data-tag")).text(encodeURIComponent(self.val()));
                    });
                });

            });
        </script>
        <script type="text/javascript">
            ActiveLeftMenu("aPluginMng");
            AddHeaderIcon("<?php echo $bloghost . 'zb_users/plugin/Totoro/logo.png'; ?>");
        </script>
    </div>
</div>
<?php
require $blogpath . 'zb_system/admin/admin_footer.php';

RunTime();
?>
